﻿<UserControl x:Class="LFMTest.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:cv="using:LFMTest.WinRT.Converters"
    mc:Ignorable="d"
    d:DesignHeight="768" d:DesignWidth="1366">
    <UserControl.Resources>
        <cv:UriToSourceConverter x:Key="UriToSourceConverter"/>
        <DataTemplate x:Key="Photos">
            <Grid Width="150" Height="150" >
                <TextBlock Text="{Binding Album}" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="5,0,0,5" />
            </Grid>
            <!--<TextBlock Text=" hello" />-->
            <!--<Image HorizontalAlignment="Left" Height="150" VerticalAlignment="Top" Margin="12" Width="150" Stretch="UniformToFill" Source="{Binding ExtraLarge.URL, Converter={StaticResource UriToSourceConverter}}" />-->
        </DataTemplate>
        <DataTemplate x:Key="AlbumsView">
            <Grid Height="150" Width="150" Margin="12">
                <Border BorderThickness="1" BorderBrush="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Text="{Binding Name}" />
                </Border>
                <Image HorizontalAlignment="Left" Height="150" VerticalAlignment="Top" Width="150" Stretch="UniformToFill" >
                    <Image.Source>
                        <BitmapImage CreateOptions="BackgroundCreation" UriSource="{Binding ImageExtraLarge}" DecodePixelHeight="150" DecodePixelWidth="150" />
                    </Image.Source>
                </Image>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" Background="#FF0C0C0C">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition />
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Button Content="Download" HorizontalAlignment="Left" Height="71" Margin="36,115,0,0" VerticalAlignment="Top" Width="229" Click="Button_Click"/>
        <ProgressRing x:Name="pRing" HorizontalAlignment="Left" Height="118" Margin="302,72,0,0" VerticalAlignment="Top" Width="125"/>
        <TextBox x:Name="tb_Input" HorizontalAlignment="Left" Height="26" Margin="36,72,0,0" Text="Jason Mraz" VerticalAlignment="Top" Width="241"/>
        <StackPanel x:Name="ResultPanel" HorizontalAlignment="Left" Height="578" Margin="36,190,0,0" VerticalAlignment="Top" Width="429">
            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="RESULT" Width="334" FontSize="18" FontWeight="ExtraBold"/>
            <TextBox HorizontalAlignment="Left" Text="{Binding Name}" Width="429"/>
            <TextBox HorizontalAlignment="Left" Text="{Binding Url}" Width="429" Height="36"/>
            <TextBox HorizontalAlignment="Left" Text="{Binding Playcount}" Width="429" Height="36"/>
            <TextBox HorizontalAlignment="Left" Text="{Binding Listeners}" Width="429" Height="36"/>
            <TextBox HorizontalAlignment="Left" Text="{Binding ImageLarge}" Width="429" Height="36"/>
            <TextBox HorizontalAlignment="Left" Text="{Binding BioSummary}" Width="429" Height="36"/>
            <Image HorizontalAlignment="Left" Height="326" VerticalAlignment="Top" Width="429" Stretch="UniformToFill" Source="{Binding ImageMega, Converter={StaticResource UriToSourceConverter}}" />
        </StackPanel>
        <Button x:Name="b_Images" Content="get Images" HorizontalAlignment="Left" Height="65" Margin="543,125,0,0" VerticalAlignment="Top" Width="208" Click="b_Images_Click"/>
        <GridView x:Name="gv_Photos" HorizontalAlignment="Left" Margin="250,100,0,0" VerticalAlignment="Top" ItemTemplate="{StaticResource Photos}" CanReorderItems="True" />
        <!--<GridView x:Name="gv_Albums" HorizontalAlignment="Left" Margin="250,100,0,0" VerticalAlignment="Top" ItemTemplate="{StaticResource AlbumsView}" />-->
        <Button x:Name="b_Pos" Content="Get Position" HorizontalAlignment="Left" Height="36" Margin="543,72,0,0" VerticalAlignment="Top" Width="208" Click="b_Pos_Click"/>
    </Grid>
    
</UserControl>